﻿using System;
using CTS.Com.Domain.Constants;
using CTS.Com.Domain.Validate.Attr;

namespace CTS.Com.Domain.Model
{
    [Serializable]
    public class BasicRequest
    {
        public bool IsAdd { get { return Status == Logics.CD_STATUS_ADD; } }
        public bool IsEdit { get { return Status == Logics.CD_STATUS_EDIT; } }
        public bool IsInit { get { return CallType == Logics.CD_CALLTYPE_INIT; } }
        public bool IsCopy { get { return CallType == Logics.CD_CALLTYPE_COPY; } }

        public bool IsAddInit { get { return IsAdd && IsInit; } }
        public bool IsAddCopy { get { return IsAdd && IsCopy; } }
        public bool IsEditInit { get { return IsEdit && IsInit; } }

        [DomainValidation(RuleName = "status", MessageParam = "P_CM_00002")]
        public string Status { get; set; }

        [DomainValidation(RuleName = "callType", MessageParam = "P_CM_00003")]
        public string CallType { get; set; }
    }
}
